package com.cskaoyan.user.converter;

import com.cskaoyan.user.dal.entitys.Member;
import com.cskaoyan.user.dto.UserLoginResponse;
import com.cskaoyan.user.form.UserRegisterRequest;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

@Mapper(componentModel = "spring")
public interface UserConverterMapper {

    @Mappings({})
    UserLoginResponse converter(Member member);

    @Mapping(source = "userPwd" ,target = "password")
    @Mapping(source = "userName" ,target = "username")
    Member userRegisterRequestToMember(UserRegisterRequest userRegisterRequest);


    UserLoginResponse memberToUserLoginResponse(Member member);
}
